package appBCN.MOs;

import java.util.ArrayList;
import java.util.Date;
import java.util.Iterator;
import java.util.List;

public class Person {

	private String name;
	private String surname;
	private String address;
	private String dni;
	private String cip;
	private String telephone;
	private String email;
	private String pwd;
	private Person doctor;
	private Person nurse;
	private List<Date>dates;
	private List<Pill>pills;
	
	
	public Person()
	{
		dates = new ArrayList<Date>();
		pills = new ArrayList<Pill>();
	}
	
	/**
	 * @param name
	 * @param surname
	 * @param cip
	 */
	public Person(String name, String surname, String dni) {
		super();
		this.name = name;
		this.surname = surname;
		this.dni = dni;
	}

	/**
	 * 
	 * @param name
	 * @param surname
	 * @param address
	 * @param dni
	 * @param cip
	 * @param telephone
	 * @param email
	 * @param pwd
	 * @param doctor
	 * @param nurse
	 */
	public Person(String name, String surname, String address, String dni,
			String cip, String telephone, String email, String pwd,
			Person doctor, Person nurse) {
		super();
		this.name = name;
		this.surname = surname;
		this.address = address;
		this.dni = dni;
		this.cip = cip;
		this.telephone = telephone;
		this.email = email;
		this.pwd = pwd;
		this.doctor = doctor;
		this.nurse = nurse;
	}
	
	/**
	 * @param name the name to set
	 */
	public void setName(String name) {
		this.name = name;
	}
	/**
	 * @return the name
	 */
	public String getName() {
		return name;
	}
	
	/**
	 * @return the surname
	 */
	public String getSurname() {
		return surname;
	}
	/**
	 * @param surname the surname to set
	 */
	public void setSurname(String surname) {
		this.surname = surname;
	}
	/**
	 * @return the address
	 */
	public String getAddress() {
		return address;
	}
	/**
	 * @param address the address to set
	 */
	public void setAddress(String address) {
		this.address = address;
	}
	/**
	 * @return the dni
	 */
	public String getDni() {
		return dni;
	}
	/**
	 * @param dni the dni to set
	 */
	public void setDni(String dni) {
		this.dni = dni;
	}
	/**
	 * @return the cip
	 */
	public String getCip() {
		return cip;
	}
	/**
	 * @param cip the cip to set
	 */
	public void setCip(String cip) {
		this.cip = cip;
	}
	/**
	 * @return the telephone
	 */
	public String getTelephone() {
		return telephone;
	}
	/**
	 * @param telephone the telephone to set
	 */
	public void setTelephone(String telephone) {
		this.telephone = telephone;
	}
	/**
	 * @return the email
	 */
	public String getEmail() {
		return email;
	}
	/**
	 * @param email the email to set
	 */
	public void setEmail(String email) {
		this.email = email;
	}
	/**
	 * @return the pwd
	 */
	public String getPwd() {
		return pwd;
	}
	/**
	 * @param pwd the pwd to set
	 */
	public void setPwd(String pwd) {
		this.pwd = pwd;
	}
	/**
	 * @return the doctor
	 */
	public Person getDoctor() {
		return doctor;
	}
	/**
	 * @param doctor the doctor to set
	 */
	public void setDoctor(Person doctor) {
		this.doctor = doctor;
	}
	/**
	 * @return the nurse
	 */
	public Person getNurse() {
		return nurse;
	}
	/**
	 * @param nurse the nurse to set
	 */
	public void setNurse(Person nurse) {
		this.nurse = nurse;
	}

	/**
	 * @return the dates
	 */
	public List<Date> getDates() {
		return dates;
	}

	/**
	 * @param dates the dates to set
	 */
	public void setDates(List<Date> dates) {
		this.dates = dates;
	}
	
	public void addDate(Date date)
	{
		if(dates == null)
			dates = new ArrayList<Date>();
		this.dates.add(date);
	}
	
	public Date getDateByID(int id)
	{
		return dates.get(id);
	}

	/**
	 * @param pills the pills to set
	 */
	public void setPills(List<Pill> pills) {
		this.pills = pills;
	}

	/**
	 * @return the pills
	 */
	public List<Pill> getPills() {
		if(pills == null)
			pills = new ArrayList<Pill>();
		return pills;
	}
}
